package com.bci.pwtz.controller.admin;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.bci.pwtz.common.util.PaginationList;
import com.bci.pwtz.controller.AbstractController;
import com.bci.pwtz.mysql.model.UserCompanyRef;
import com.bci.pwtz.service.UserCompanyRefService;

@Controller
@RequestMapping("/admin/usercompanyref")
public class UserCompanyRefController extends AbstractController
{
@Autowired
UserCompanyRefService service;

@RequestMapping(value="/list",method=RequestMethod.POST)
@ResponseBody
public List<UserCompanyRef> userStatics(String begintime,String endtime,String companyName){
    List<UserCompanyRef> list=new ArrayList<UserCompanyRef>();
    try{
        list=service.userStatics(begintime, endtime, companyName);
    }catch(Exception e){
        handleException(e);
    }
    return list;
}

@RequestMapping(value="/userlist",method=RequestMethod.POST)
@ResponseBody
public PaginationList<UserCompanyRef> companyUserList(Long companyId,int pageSize,int pageNo){
    PaginationList<UserCompanyRef> list=new PaginationList<UserCompanyRef>();
    try{
        list=service.selectCompanyUserList(companyId, pageSize, pageNo);
    }catch(Exception e){
        handleException(e);
    }
    return list;
}
}
